package test.com.db.server.requirements.highload;

public class Stats {
    private volatile long slowResponds = 0;
    private volatile long fastResponds = 0;

    public synchronized void slow() {
        ++slowResponds;
    }

    public synchronized void fast() {
        ++fastResponds;
    }

    public long numOfResponds(){
        return slowResponds + fastResponds;
    }

    public double ratio() {
        return slowResponds/(double)fastResponds;
    }

    public long numOfSlow() {
        return slowResponds;
    }
}
